package base.thread_JUC2.chapter04.demo07;

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class Task implements Runnable{
    private String name;
    public Task(String name){
        this.name = name;
    }

    @Override
    public void run() {
        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.printf("%s -> %s 任务开始执行: %s \n", Thread.currentThread().getName(), name, new Date());
    }
}
